home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / NANO116.ZIP / STUFF.EXE / NSTRUC.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-02-04  |  22.2 KB  |  544 lines

  1. (*
  2.                     STRVCTVRA et PRINCIPIA MATHEMATICA
  3.  
  4.                                  NanoBBS
  5.                 (C) Copyright 1993-1996 Whirlwind Software
  6.                            ALL RIGHTS RESERVED
  7.  
  8.   NanoBBS: A kickass BBS with support for 3 type of msgbases, internal
  9.   protocols, doors, no-nodelist netmail, Usenet and Internet Email hooks,
  10.   the UFO Scripting language, fixed period or credit usage billing/expiry,
  11.   on the fly true ANSI, RipScrip, hyper-fast file finding, etc etc etc.
  12.   Designed to be fast and efficient, easy for both user and sysop to use.
  13.  
  14.   SOCIAL STATEMENT TO THIRD PARTY DEVELOPERS:  *PLEASE* do not write
  15.   code that physically inserts or deletes users from anywhere but the
  16.   end of the user file!  This practice has been used in third party user
  17.   editors for other BBSes in the past and has caused the LASTREAD files
  18.   used by Squish and *.MSG to become invalid!  At the very least,
  19.   consider using an active global lastread updater procedure if you MUST
  20.   physically move, insert or delete user records!!!
  21.  
  22.   THESE STRUCTURES ARE NOT FINAL.  Major structures such as the user record
  23.   and config record have free space fields which may be used in the future,
  24.   but existing fields will stay where they are.  Do not use free space
  25.   fields unless you want your ultilities to become obsolete next beta.  To
  26.   ensure compatibility, it is prudent to update the flat text configuration
  27.   files whenever possible and then run MFB or MMB or CONFIG as needed.
  28.   Whirlwind Software reserves the right to alter and/or augment these
  29.   structures as it deems necessary.
  30.  
  31.   The user record structure will be changed in version 2.00!  New
  32.   structure source will be released along with a userbase conversion
  33.   program when this happens, and NanoBBS 2.00 will recognize the old
  34.   version file and convert it for you.  The TCHAT.USR file will be
  35.   eliminated and its fields added to the main structure, and a hyper-speed
  36.   search index similar to that used in the file database will be put in
  37.   place.
  38.  
  39. *)
  40.  
  41. type _pt=array[0..15] of record       {Comm Port Record}
  42.                            base:word;
  43.                            irq :byte
  44.                          end;
  45.  
  46.   namestr=string[35]; {You may need to distinguish dos.namestr from this one in your code}
  47.  
  48. type limit=record
  49.              access,             {Access level for this limit}
  50.              time,               {time per call}
  51.              day,                {time per day}
  52.              ratio    : word;    {N:1 dl/ul ratio}
  53.              maxk     : longint; {Maximum kilobytes downloaded per day}
  54.              maxfiles : word;    {Maximum files downloaded per day}
  55.              name     : string[60]; {What we call this access level}
  56.              cph      : longint; {Credits per hour}
  57.            end;
  58.  
  59.   baudrec=record
  60.             setbaud,                {Baud to set modem to, 0 if locked}
  61.             baudrate  : longint;    {Baud rate for calculation - 0 if local}
  62.             baudstr   : string[6];  {Baud rate for display}
  63.             connect   : string[40]; {Connect string as returned by modem}
  64.           end;
  65.  
  66.   addrec=record
  67.             zone,
  68.             net,
  69.             node,
  70.             point     : integer;
  71.           end;
  72.  
  73.   accessrecord=record   {Access classes used by NanoCHAT}
  74.                  sysop,
  75.                  vip,
  76.                  normal,
  77.                  loser,
  78.                  newuser     : limit;
  79.                end;
  80.  
  81.   compressrec=record
  82.                 name:string[40];
  83.                 extension:string[3];
  84.                 viewcommand,
  85.                 addcommand,
  86.                 extractcommand:string[80];
  87.                 idoffset:longint;     {offset of bytes within file which ID file}
  88.                 idlen:byte;           {number of ID bytes within file}
  89.                 idbytes:array[1..8] of byte;  {the actual bytes}
  90.               end;
  91.  
  92.  
  93.   configrec =
  94.     record
  95.       fileid      : longint;       {Always $54484332 "THC2"}
  96.       comport     : byte;          {Com port, 0 is local only}
  97.       node        : word;          {Task number}
  98.       syspass,                     {System Password}
  99.       nup         : string[12];    {New User Password}
  100.       initbaud,                    {Baud to initialise modem - 0 if lock}
  101.       slowbaud    : longint;       {Slowest baud rate to allow on}
  102.       bauds       : array[0..19] of baudrec; {Baud config}
  103.       ring        : string[20];    {String for ring}
  104.       answer      : string[20];    {Answer string}
  105.       init        : string[60];    {Init string}
  106.       nocarrier   : string[20];    {No Carrier String}
  107.       ok          : string[20];    {OK string}
  108.       initretry   : byte;
  109.       rings       : byte;          {Number of rings to answer}
  110.       textpath,
  111.       syspath,                     {System Files Path}
  112.       msgbasepath : string[60];    {Message Base Path}
  113.       systemname  : string[72];
  114.       sysopname   : namestr;
  115.       systemcity  : namestr;
  116.       systemphone : string[20];
  117.       echochar    : char;
  118.       passwordtries:byte;
  119.       asknew      : word;          {16 booleans determining what new users should be asked}
  120.       logontime   : byte;          {Minutes allowed in logon process}
  121.       timeout     : byte;          {Minutes to time out}
  122.       bangaccess  : word;          {Access required to use Bang Prompt}
  123.       unused_x    : word;
  124.       usrstart,                    {When to start answering phone}
  125.       usrend,                      {When to stop answering phone}
  126.       chatstart,                   {When to start allowing chat}
  127.       chatend     : longint;       {When to stop allowing chat}
  128.       newaccess,
  129.       sysopaccess : word;
  130.       newkeys,
  131.       sysopkeys   : word;
  132.       fastanswer  : boolean;
  133.       ramdisk     : string[60];    {Drive and directory of ramdisk}
  134.       temppath    : string[60];    {Where to place temporary files}
  135.       scanpath    : string[60];    {Where to put user msgscan files}
  136.       threshold   : longint;       {Download limit threshold}
  137.       ulreward    : longint;       {Percentage of uploads to reward}
  138.       firstbull   : string[13];    {pathless filename of first bulletin menu .NIX file}
  139.       access_files,
  140.       access_expired,
  141.       access_doors,
  142.       access_userlist,
  143.       access_callog,
  144.       access_page,
  145.       access_info,
  146.       access_qwk,
  147.       access_email,
  148.       access_kill,
  149.       access_post,
  150.       access_read,
  151.       access_scan,
  152.       access_newscan,
  153.       access_batch,
  154.       access_download,
  155.       access_upload,
  156.       access_filelist,
  157.       access_newfiles,
  158.       access_fsearch:word;         {Access levels for many functions}
  159.       autoansi:word;               {milliseconds to wait for auto-ansi}
  160.       warn1,
  161.       warn2: word;                 {Seconds-until-logoff for warnings}
  162.       hitenter:boolean;
  163.       startfile:string[72];        { Starting UFO file (before logon)      }
  164.                                    { NanoBBS will use canned logon if this }
  165.                                    { is blank                              }
  166.       mainfile:string[72];  {Main UFO file, canned main menu if blank (after logon)}
  167.       wideopen:boolean; {If true BBS skips logon procedure completely}
  168.       defaultlang:string[8];  {base filename of default language - usu. ENGLISH}
  169.       language:array[1..32] of string[8]; {Language filenames}
  170.       ovrstr:string[100];
  171.       ovrkey:array[1..100] of string[9];
  172.       optnew:word;    {16 booleans determining which asked questions are optional}
  173.       initfreq:byte; {time between modem inits in minutes}
  174.       f_files:string[72];
  175.       f_message:string[72];
  176.       f_doors:string[72];
  177.       qwkpath:string[60];
  178.       qwkid:string[8];
  179.       compress:array[1..16] of compressrec;
  180.       netmachine:string[16]; {Internet machine name}
  181.       netaddress:string[80]; {Internet site address, e.g. thc.spydernet.com}
  182.       timezone:string[8];    {Time zone string code}
  183.       greenwich1:shortint; {Hours from UTC in standard time, e.g. PST is -8}
  184.       greenwich2:shortint; {Hours from UTC in daylight time, e.g. PDT is -7}
  185.       anonstring:string[36]; {The string to substitute when a person posts anonymously}
  186.       netmailkillsent,       {If true netmail will be marked kill/sent}
  187.       netmailcrash:boolean;  {If true netmail will be marked crash}
  188.       creditsystem:boolean;  {If true, this is a credit-based system}
  189.       spinstring:string[16];  {String defining the "Spinny" cursor}
  190.       swapems:boolean;      {If true, swap to EMS when swapping out}
  191.       maxbankdep:longint;   {maximum allowed deposit}
  192.       maxbankwd:longint;    {maximum allowed withdrawal}
  193.       wraplongdesc:boolean; { If true BBS will ignore line breaks in long}
  194.                             { descriptions and attempt to wrap the       }
  195.                             { descriptions optimally                     }
  196.       ipcpath:string[60];   {path to IPC files for NanoCHAT etc}
  197.       multinode:boolean;    {If true IPCs will be used}
  198.       access_multi:word;
  199.       pagemusic:string[72]; {Filename of PagePlay file for sysop paging noise}
  200.       nextmusic:string[72]; {Not used at this time}
  201.       fatalmusic:string[72]; {Filename of PagePlay file for fatal error noise}
  202.       usefilegroups:boolean; {If true Nano will use File Groups}
  203.       chatprompt:boolean;    {If true, most prompts will behave like NanoCHAT}
  204.       access_validated,           {Access to give reviewed users}
  205.       access_nixad      :word;    {Access to be allowed to use NixAd}
  206.       bankul:boolean; {If true, time for uploads is automatically banked}
  207.       postfreeze:boolean; {If true, clock is frozen during posting}
  208.       rewardprivate:boolean; {If true, post rewards apply to private msgs too}
  209.       rewardcutoff:integer; {Number of lines to qualify for postreward2}
  210.       postreward1,         {Minutes to add to timebank for posting <rewardcutoff lines}
  211.       postreward2:integer; {Number of minutes to add to timebank for posting >=rewardcutoff lines}
  212.       ulby:boolean;  {If TRUE Nano will append an "Uploaded By:" to file descriptions}
  213.       hidesysop:boolean; {If True Sysop not counted in daily call logs}
  214.       lockedbaud:boolean;
  215.       qwklimit:word;  {Max number of messages per QWK packet}
  216.       nodoorscreenrestore:boolean;
  217.       globalemailscan: boolean; {If true, users new email scans are global}
  218.       porttable:_pt; {Com port table for internal comm driver}
  219.       nofossil:boolean; {If true use BBS's internal comm driver instead of FOSSIL}
  220.       privatemsg:longint;
  221.       fovrstr:string[30];  {This and fovrkey allow key overrides in the file section}
  222.       fovrkey:array[1..30] of string[9];
  223.       noonewordnames:boolean; {If true, NanoBBS will prohibit one word names in new user signup}
  224.       noonewordreals:boolean; {If true, NanoBBS may allow one word usernames but will prohibit one word real names}
  225.  
  226.       freespace :array[1..6908] of byte; {Pad it to 16384 bytes}
  227.       beta_id   :string[5]; {ASCII Beta identifier - contains ***** if not a beta}
  228.       version_id:string[5]; {ASCII Version of BBS created for}
  229.     end;
  230.  
  231. { asknew significance:
  232.  
  233.         bit    meaning
  234.         ---    -------
  235.          F     [ unused ]
  236.          E     [ unused ]
  237.          D     [ unused ]
  238.          C     [ unused ]
  239.          B     [ unused ]
  240.          A     [ unused ]
  241.          9     Ask Language
  242.          8     Ask Editor
  243.          7     Ask Location
  244.          6     Ask Real Name
  245.          5     Ask Phone
  246.          4     Ask New Scan
  247.          3     Ask Screen Parms
  248.          2     Ask Birthdate
  249.          1     Ask Gender
  250.          0     [ unused ]
  251. }
  252.  
  253.   userrec=record
  254.             uuid:longint;
  255.             username,
  256.             realname,
  257.             location : namestr;
  258.             password : string[12];
  259.             phone    : string[20];
  260.             access   : word;
  261.             lastcall,
  262.             firstcall: longint;
  263.             downloads: longint;    {Downloads in k}
  264.             uploads  : longint;    {Uploads in k}
  265.             calls    : word;
  266.             calltoday: word;
  267.             elapsed  : word;
  268.             todayk   : word;
  269.             birthdate: string[8];
  270.             keysold  : word;       {Bitmap keys 0..F}
  271.             attribute: word;       {Bitmap attribute}
  272.             posts    : word;
  273.             lines,
  274.             columns  : byte;
  275.             expiry   : longint;    {Expiry Date}
  276.             bank     : integer;    {Minutes in the time bank}
  277.             unused3  : byte;
  278.             keys     : longint;
  279.             inetname : string[9];  {Internet name, 9 chars}
  280.             notused  : word;
  281.             misc     : array[1..4] of longint;
  282.             lastwd,                {ds1970 of last time bank withdrawal}
  283.             wdtoday  : word;       {time bank withdrawal minutes today}
  284.             credit,                {Credit}
  285.             pending  : longint;    {Value of unsent netmail in credits}
  286.             unused2  : array[1..3] of byte;
  287.             chatrc   : word;       {Abs. Record # in TCHAT.USR}
  288.             language : string[8];
  289.             protocol : char;
  290.             archiver : byte;
  291.           end;
  292.  
  293.   usrhashrec=record
  294.                hashname,
  295.                hashreal,
  296.                recnum:longint;
  297.              end;
  298.  
  299. {Meanings of attributes:
  300.  
  301.            Bit  Meaning
  302.            ---  -------
  303.  8000       F - 1=female 0=male
  304.  4000       E - Account suspended
  305.  2000       D - No Time Limit
  306.  1000       C - No Ratio
  307.   800       B - Clear Screen
  308.   400       A - Use linefeeds
  309.   200       9 - Check for new mail
  310.   100       8 - Sex Undisclosed
  311.    80       7 - [ unused ]
  312.    40       6 - Use FS Editor
  313.    20       5 - [ unused ]
  314.    10       4 - Has been reviewed by sysop
  315.     8       3 - Goofus (Page Squelch)
  316.     4       2 - ANSi On
  317.     2       1 - Toast
  318.     1       0 - Account Deleted
  319. }
  320.   LASTCALLrecord = record
  321.                      callnum        : longint;
  322.                      node           : Byte;
  323.                      Name           : namestr;
  324.                      Baud           : longint;
  325.                      Times          : LongInt;
  326.                      LogOn          : longint; {Second-of-the-day}
  327.                      LogOff         : longint;
  328.                    end;
  329.  
  330.   SYSINFOrecord  = record
  331.                      TotalCalls     : LongInt;
  332.                      LastCaller     : namestr;
  333.                      CallsToday     : Word;
  334.                      ConnectsToday  : word;
  335.                      poststoday,
  336.                      ultoday,
  337.                      dltoday        : word;
  338.                      lastconnect    : longint;
  339.                      date           : word;
  340.                      nocd           : boolean;
  341.                      expansion      : array[1..64] of byte;
  342.                    end;
  343.  
  344.   const base_sq:byte=0;
  345.         base_fido:byte=1;
  346.         base_jam:byte=2;
  347.  
  348.   type
  349.  
  350. {Note - if BaseType is 255 then this is not a message base but a "divider" to }
  351. {       make message area lists look neater.                                  }
  352. {       In dividers, the ATTACHPATH contains the string to use in the divider }
  353. {       There is a sysmsg in which that name is parameter[1]                  }
  354. {       Optionally a pathed filename of a compiled UFO file can be provided   }
  355. {       This filename is provided in the PATH field.  If it is present Nano   }
  356. {       will present that UFO file instead of displaying the relevant SysMsg  }
  357. {       In a divider, the NUMBER field is always -1                           }
  358. {       Dividers are only recognized by MMB 2.0 and later                     }
  359.   messagerec =record
  360.                 number  : longint;
  361.                 basetype: byte; {0=Squish,1=SDM,2=JAM,255=NotABase}
  362.                 name    : string[60];
  363.                 attachpath,
  364.                 path    : string[72];
  365.                 attachaccess,
  366.                 anonaccess,
  367.                 bogusaccess,
  368.                 postaccess,
  369.                 access  : word;
  370.                 postkeys,
  371.                 keys    : word;
  372.                 address : addrec;
  373.                 origin  : string[60];
  374.                 attr2,
  375.                 attr    : word;
  376.                 maxmsg  : word;
  377.                 age     : byte;
  378.                 qwkname : string[13];
  379.                 newsgroup:string[78]; {Newgroup for RFC headers}
  380.                 divert  : longint;
  381.                 destination:addrec; {Force this dest if netmail area}
  382.                 recordnum:longint; {Physical record number}
  383.                 version : word;    {MMB version which created this record}
  384.                 freespace:array[1..14] of byte;
  385.               end;
  386.  
  387.  
  388. {messagerec.attr significance:
  389.  
  390.       bit 0x8000  -  Females only may enter this base
  391.           0x4000  -  Males only may enter this base
  392.           0x2000  -  Base is read-only
  393.           0x1000  -  Base is echomail
  394.           0x0800  -  Base is netmail
  395.           0x0400  -  Base is private only
  396.           0x0200  -  Base is public only
  397.           0x0100  -  Hi-bit characters allowed
  398.           0x0080  -  ANSi allowed
  399.           0x0040  -  NanoBBS tokens allowed
  400.           0x0020  -  Use real name (off=use username)
  401.           0x0010  -  Allow anonymous posting
  402.           0x0008  -  Allow bogus posting
  403.           0x0004  -  CENSORED!
  404.           0x0002  -  File Attach Allowed
  405.           0x0001  -  Kludge real name
  406.  
  407.   attr2 significance:
  408.      bit  0x8000  -  Internet email base
  409.      bit  0x4000  -  Usenet newsgroup
  410.      bit  0x2000  -  Add RFC-1036 header
  411.      bit  0x1000  -  Barricade area
  412.      bit  0x0800  -  Use the destination address instead of asking for netmail address
  413.      bit  0x0400  -  First try to reply to parsed Internet address
  414.      bit  0x0200  -  If to: appears to be on inet, change area to msg.divert
  415.  
  416. }
  417.  
  418. {
  419.  
  420.    The FAINFO file contains records of information about the individual
  421.    file areas.
  422.  
  423.     ATTR field: bit F - Area is a CD-ROM, use temporary dir, no uploads
  424.                     E - No uploads allowed
  425.                     D - Area uses indented continuation in FILES.BBS
  426.                     C - FILES.BBS lines already have filesize/date
  427.                     B - Do not include area in MASTER.FIL
  428.                     A - [ unused ]
  429.                     9 - [ unused ]
  430.                     8 - [ unused ]
  431.                     7 - [ unused ]
  432.                     6 - [ unused ]
  433.                     5 - [ unused ]
  434.                     4 - [ unused ]
  435.                     3 - [ unused ]
  436.                     2 - [ unused ]
  437.                     1 - [ unused ]
  438.                     0 - VOID - area is invalid!
  439.  
  440.   Note: the UNUSED byte is now used to indicate if the file area is
  441.   actually a divider.  If UNUSED is 255, the entry is a divider.
  442.   The divider text is stored in ULPATH and the filename is in DLPATH.  NAME
  443.   is not used.
  444.  
  445. }
  446.  
  447.      fainfo = record
  448.                 number:longint;         {File Area Number}
  449.                 name:namestr;        {File Area Name as seen by user}
  450.                 filesbbspath,        {Path for FILES.BBS}
  451.                 dlpath,              {Path for downloads}
  452.                 ulpath:string[72];   {Path for uploads}
  453.                 access:word;         {Required Access}
  454.                 age:byte;
  455.                 ulaccess,
  456.                 dlaccess,
  457.                 ulkeys,
  458.                 dlkeys:longint;         {Unused}
  459.                 keys:longint;           {Required Keys}
  460.                 attr:word;           {Attributes - see above}
  461.                 unused:byte;
  462.                 group:byte;
  463.                 freespace:array[1..16] of byte;
  464.               end;
  465. (*
  466.     bulltype=record
  467.                key      : char;
  468.                display  : string[127]; {What to display}
  469.                filename : string[60]; {Filename of bulletin or menu}
  470.                link     : boolean;  {If false, this record is an actual bulletin}
  471.                quit     : boolean;  {If true, the key will actually quit}
  472.              end;
  473. *)
  474.     callerrec=record
  475.                 location,
  476.                 username,
  477.                 realname  : namestr;
  478.                 time,
  479.                 number    : longint;
  480.                 baud      : string[10];
  481.               end;
  482.  
  483.    doortype=record
  484.               key:char;      {Key which opens the door}
  485.               path:string[60]; {Directory to write DORINFO1.DEF and log to}
  486.               command:string[72]; {Command and all parameters necessary}
  487.               swap:boolean;  {If true we will attempt a swapout type drop}
  488.               access:word;   {Required access}
  489.               keys:word;     {Required keys}
  490.               flavour:byte;  {0=DORINFO1.DEF  1=DORINFOx.DEF}
  491.               age:integer;   {minimum age to play}
  492.               fossilhot:boolean; {true:leave FOSSIL hot (shd be true most doors)}
  493.               realname:boolean; {true: use REAL name instead of pseudo}
  494.               fakelastname:string[16]; {What to put for users with one word handles when a door requires a last name}
  495.               fakebaud:longint; {A fake baud rate to kludge in for lame doors}
  496.               expansion:byte;
  497.               freespace:array[1..32] of byte;
  498.             end;
  499.  
  500.    evtrec=record
  501.             Name:string[60];
  502.             time:array[1..32] of longint;
  503.             errorlevel:byte;
  504.             attr:byte;
  505.             spare:byte;
  506.           end;
  507.  
  508. {Event attribute bits: $80=forced}
  509.  
  510.   grouprec=record
  511.              number:byte;
  512.              name:string[72];
  513.              keys:word;
  514.              access:word;
  515.            end;
  516.  
  517.      _idxrecord=record              {Structure of records in MASTER.IDX}
  518.                   name:string[12];
  519.                   area:longint;
  520.                   offset:longint;
  521.                 end;
  522.  
  523.      {Structure of MASTER.PRE}
  524.      preidxarray=array[1..27,1..27] of longint; {1,1=AA 27,27=##}
  525.  
  526.      { Note: MASTER.FIL is a flat ASCII file which is trivially reverse }
  527.      { engineered.                                                      }
  528.  
  529. (* External Protocols are not yet a feature of NanoBBS so this structure is *)
  530. (* not official and will probably be changed.                               *)
  531.  
  532.  
  533.   extproto=record
  534.              name:string[40];
  535.              key:char;
  536.              uploadcmd:string[80];
  537.              downloadcmd:string[80];
  538.              flavour:byte; {bitmap $01=batch $02=bidir}
  539.              uploadlogfile:string[80];
  540.              downloadlogfile:string[80];
  541.              downloadlistname:string[80];
  542.            end;
  543.  
  544.